feat(objectql): duplicate a writable base — ADR-0070 D4#2299
Merged
Conversation
… reference rewrite (ADR-0070 D4) protocol.duplicatePackage clones a base's ACTIVE items into a new package, re-namespacing object names (avoids the (type,name) collision) and rewriting intra-package references (lookup reference / view object / expressions) via a longest-first identifier-boundary replace. + POST /packages/:id/duplicate. +tests (re-namespacing + reference rewrite + boundary-safety). Completes D4 (delete + export already shipped). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 25 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the missing piece of ADR-0070 D4 (package = lifecycle unit). Delete-cascade (
protocol.deletePackage+?keepData) and export (GET /packages/:id/export) already shipped; this adds duplicate:protocol.duplicatePackage— clones every ACTIVE item a base owns into a NEW package, re-namespacing object names (the blueprint prefixes object names with the base namespace, e.g.iojn_repair_ticket;sys_metadatakeys on(type,name,org), so a same-name copy would collide with the source) and rewriting every intra-package reference (lookupreference, viewobject, expressions, …) to the new names via a longest-first, identifier-boundary replace (soiojn_tasknever corruptsiojn_task_log).POST /packages/:id/duplicate(body{ targetPackageId, targetName?, targetNamespace? }).Tests
@objectstack/objectql: 708 green incl. newduplicatePackagetests — re-namespacing, lookup-reference + view-object rewrite, and boundary-safety;tscclean. (The runtime endpoint mirrors the existingrevert/rollbackpackage routes.)Follow-up
objectui
PackageDetailSheet"Duplicate" button (wires to this endpoint) — small UI add. ThekeepDataschema-vs-data delete choice could also be surfaced in the UI.Completes ADR-0070 D4. (D5 migration / D6 framing remain.)
🤖 Generated with Claude Code